# 基础
import random

a = 10
print(type(a))
a = "hello"
print(type(a))
a = 2.2
print(type(a))
a = True
print(type(a))
# 元祖
b = ()
print(type(b))
# 列表
c = []
print(type(c))
# 字典
d = {}
print(type(d))

i = 10
y = 5
# 算数运算符
print(i + y)
print(i - y)
print(i * y)
# 指数，左边底数，右边指数
print(i ** y)
print(i % y)
print(i / y)
# 忽略小数
print(i // y)

# 比较运算符
print(i == y)
print(i != y)
print(i > y)
print(i < y)
print(i >= y)
print(i <= y)

# 逻辑运算符
print(not i > 0)
print(i > 0 and y < 0)
print(i > 0 or i > 0)

# 赋值运算符
j = i
print(j)
j += i
print(j)
j -= i
j *= i
j /= i
j %= i
j **= i
j //= a

# 符号
# %c 字符
# %s 字符串
# %i 有符号十进制整数
# %d 有符号十进制整数
# %u 无符号十进制整数
# %o 八进制整数
# %x 十六进制整数
# #e 索引符号(小写'e')
# %E 索引符号(大写'E')
# %f 浮点实数
# %g %f和%e的简写
# %g %f和%E的简写

# 输出
name = "an"
age = 30
print("我%s,今年%d" % (name, age))
print("我{},几年{}".format(name, age))

# 输入input str类型
# print("我" + input("姓名") + ",今年" + input("年龄"))

if i > 0:
    print("if")
    pass
elif i > 5:
    print("elif")
else:
    print("else")
    pass

# 0：石头 1：剪刀 2：布
# count = 0
# while count <= 10:
#     q = int(input("出拳"))
#     computer = int(random.randint(0, 2))
#     print("你：{}".format(q))
#     print("电脑:{}".format(computer))
#     if q == 0 and computer == 1:
#         print("你赢了")
#     elif q == 0 and computer == 2:
#         print("你输了")
#     elif q == 1 and computer == 0:
#         print("你输了")
#     elif q == 1 and computer == 2:
#         print("你赢了")
#     elif q == 2 and computer == 0:
#         print("你赢了")
#     elif q == 2 and computer == 1:
#         print("你输了")
#     else:
#         print("平手")
#     count += 1

row = 1
while row <= 9:
    col = row
    while col <= 9:
        print("%d*%d=%d" % (row, col, row * col), end=" ")
        col += 1
        pass
    print()
    row += 1
    pass
print("正方形")
row = 1
while row <= 9:
    col = 1
    while col <= row:
        print("%d*%d=%d" % (row, col, row * col), end=" ")
        col += 1
        pass
    print()
    row += 1
    pass
print("长方形")
row = 1
while row <= 19:
    col = 1
    while col <= row:
        print("*", end=" ")
        col += 1
    print()
    row += 1
print("正三角")
row = 1
while row <= 5:
    col = 1
    while col <= 15:
        print("*", end=" ")
        col += 1
    print()
    row += 1
print("倒三角")
row = 10
while row >= 1:
    col = 1
    while col <= row:
        print("*", end=" ")
        col += 1
    print()
    row -= 1
print("等腰三角形")
row = 1
while row <= 9:
    blank = 1
    while blank <= 9 - row:
        print(" ", end=' ')
        blank += 1
    col = 1
    while col <= row * 2 - 1:
        print("*", end=" ")
        col += 1
    print()
    row += 1

sum = 0
for data in range(1, 101):
    sum += data
print(sum)

for data in range(1, 101):
    if data % 2 == 0:
        print(data)

for row in range(1, 10):
    for col in range(1, row + 1):
        print("%d*%d=%d" % (col, row, row * col), end=" ")
    print()
print()
for row in range(1, 10):
    for data in range(row, 10):
        print("%d*%d=%d" % (col, row, row * col), end=" ")
    print()

for date in range(1,10):
    print(date)
    if date == 5:
        break
else:
    print("执行完毕")

for date in range(3):
    account = input("账号：")
    psw = input("密码")
    if account =="apy" and psw == "an":
        print("登录成功")
        break
    print("账号或者密码输入错误")
else:
    print("您的账号被锁定")